# Maintainer: Felix Yan <felixonmars@archlinux.org>

shopt -s extglob

pkgbase=unicode-cldr
pkgname=(unicode-cldr unicode-cldr-annotations)
pkgver=42.0
pkgrel=1
pkgdesc="Unicode Common Locale Data Repository"
arch=('any')
url="http://cldr.unicode.org/"
license=('custom')
source=("https://unicode.org/Public/cldr/${pkgver%.*}/cldr-common-$pkgver.zip")
sha512sums=('315448fe6a9ac2d5a6a7fd1a27b38c5db30fed053654a803d50e3a8d06aa08ad153e8e57089fa094c561f41a54f37eecda0701b47a1813879902be71945aa38a')

package_unicode-cldr-annotations() {
  pkgdesc="Unicode Common Locale Data Repository (annotations only)"

  cd common
  install -dm755 "$pkgdir"/usr/share/unicode/cldr/common
  cp -r annotations "$pkgdir"/usr/share/unicode/cldr/common/
  install -Dm644 ../LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}

package_unicode-cldr() {
  depends=('unicode-cldr-annotations')

  cd common
  install -dm755 "$pkgdir"/usr/share/unicode/cldr/common
  cp -r !(annotations) "$pkgdir"/usr/share/unicode/cldr/common/

  install -Dm644 ../LICENSE.txt -t "$pkgdir"/usr/share/licenses/$pkgname/
}
